-- Author: roger
with Ada.Exceptions; use Ada.Exceptions;
with Ada.Text_Io; use Ada.Text_Io;
with Ada.Integer_Text_Io; use Ada.Integer_Text_Io;

package PajekFileProcess is

    MaxLineLength : CONSTANT Integer := 255;
    
    type linkArray is array(Natural range <>) of Integer;
    type linkArrayAccess is access linkArray;
    
    
    -- Protected Node Occupation
    protected type NodeOccupation is
          entry ocupe;
          procedure leave;
          function isFree return Boolean;
          function nTimesVisited return Integer;
       private
          occupied : Integer := 0;
          free : boolean:= true;
          timesVisited: Integer:=0;
    end NodeOccupation;
    
    TYPE Node is RECORD
            Name: String(1 .. 20);
            links: Integer;
            id: Positive;
            linkList: linkArrayAccess;
            occupation: NodeOccupation;
    end record;
    
    TYPE NodeArray is array(Natural range <>) of Node;
    TYPE NodeArrayAccess is access NodeArray;
    
    TYPE NodeList is Record
            nNodes: Positive;
            nodes: NodeArrayAccess;
    end record;

    type NodeListPointer is access all NodeList;
    
    function LoadPajekFile(filename: in String) return NodeListPointer;


    
end PajekFileProcess;
